1. Field of the Invention
Apparatuses and methods consistent with the present invention relate to three-dimensional (3D) graphic rendering, and more particularly, to 3D graphic rendering which can effectively perform alpha blending on a plurality of translucent objects of a 3D graphical user interface (GUI) by sequentially aligning the translucent objects.
2. Description of the Related Art
Three colors, red (R), green (G) and blue (B), are generally used to render images. An alpha channel may be additionally used to render images. An alpha channel indicates the transparency of each pixel of an image and is represented by a value between 0 and 255. If an alpha channel has a value of 0, each pixel of the subject image is fully transparent. On the other hand, if an alpha channel has a value of 255, each pixel of the subject image is fully opaque. An alpha channel is used to add transparency in images when blending transparent objects in the image such as a glass window or a glass cup. Such blending of transparent images is referred to as alpha blending.
Recently, alpha blending has been implemented in various embedded systems for rendering translucent objects, which have a small depth with respect to one of the coordinate system axes and are adjacent to one another, such as a menu of a GUI. That is, alpha blending is a technique of rendering translucent objects by blending the colors of overlapping translucent objects. The color of a translucent object may be determined by blending the color of the translucent object and the color of an object that underlies the translucent object in a certain ratio corresponding to the transparency of the translucent object.
The results of performing alpha blending on a number of objects within an image may vary according to the order in which the objects are rendered. Thus, in order to provide a precise alpha blending result, translucent 3D objects must be properly rendered in order of the distances of the translucent 3D objects from a predetermined visual point. That is, if alpha blending is performed on translucent 3D objects that are rendered in an improper order, the result of alpha blending may not be precise or visually acceptable. Therefore, it is important to render objects in a proper order for accurate and precise alpha blending.
In order to achieve this goal, various alignment techniques for sequentially aligning objects have been developed. For example, the painter's algorithm is an algorithm for deciding which object among a plurality of overlapping objects is to be painted in front of the others. The painter's algorithm generally provides mathematically precise rendering results. However, since the painter's algorithm involves the alignment of two-dimensional (2D) polygons, the performance of the painter's algorithm is highly dependent upon the number of polygons used. In addition, in the case of rendering 3D objects, it generally takes a considerable amount of complicated computation to determine the relative positions of a plurality of objects with respect to a predetermined visual point. Thus, the painter's algorithm may not be suitable for use in real-time rendering.
Alternatively, alignment techniques involving the use of a space partitioning data structure such as a binary space partitioning (BSP) tree or a k-dimensional (kD) tree may be used. In these alignment techniques, the relative positions of a plurality of objects with respect to a visual point are determined using 3D planes, and a tree is configured based on the result of the determination. Once the tree is obtained, the objects can be quickly aligned as a visual point changes during a run time based on the configured tree. However, whenever a position of an object changes, a new tree needs to be configured. Thus, the above-mentioned alignment techniques may not be suitable for use in applications such as 3D GUIs, which include animation objects.
Therefore, it is desirable to develop a rendering apparatus which can considerably reduce the amount of computation required for the alignment of objects, realize precise alpha blending in real time, and be suitable for use in an embedded system having limited hardware performance.